package cn.kgc.tcst004.maoqichao.crowdfundingadminspringboot.service;

import cn.kgc.tcst004.maoqichao.crowdfundingadminspringboot.mapper.TagMapper;
import cn.kgc.tcst004.maoqichao.crowdfundingadminspringboot.pojo.Menu;
import cn.kgc.tcst004.maoqichao.crowdfundingadminspringboot.pojo.Tag;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TagServiceImpI implements TagService{
    @Resource
    TagMapper tagMapper;
    @Override
    public List<Tag> getAll() {
        return tagMapper.selectByExample(null);
    }

    @Override
    public void saveTag(Tag tag) {
        tagMapper.insert(tag);
    }

    @Override
    public Tag getTagById(Integer id) {
        return tagMapper.selectByPrimaryKey(id);
    }

    @Override
    public void update(Tag tag) {
        tagMapper.updateByPrimaryKeySelective(tag);
    }

    @Override
    public void tagRemove(Integer id) {
        tagMapper.deleteByPrimaryKey(id);
    }
}
